<div class="poll-list-container">
    <a href="/admin/" class="admin-access-btn" title="后台管理系统">
        <svg viewBox="0 0 24 24" width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" stroke="currentColor" stroke-width="2"/>
            <path d="M12 15a3 3 0 100-6 3 3 0 000 6z" stroke="currentColor" stroke-width="2"/>
        </svg>
        <span>后台管理</span>
    </a>
    {% if latest_question_list %}
        <div class="poll-header">
            <h1 class="poll-list-title">正在进行的投票</h1>
            <div class="poll-subtitle">选择您想参与的投票</div>
        </div>
        <ul class="poll-list">
        {% for question in latest_question_list %}
            <li class="poll-item">
                <a href="{% url 'polls:detail' question.id %}" class="poll-link">
                    <div class="poll-icon">📊</div>
                    <div class="poll-content">
                        <h3 class="poll-question">{{ question.question_text }}</h3>
                        <div class="poll-meta">点击参与投票</div>
                    </div>
                    <div class="poll-arrow">›</div>
                </a>
            </li>
        {% endfor %}
        </ul>
    {% else %}
        <div class="no-polls">
            <div class="no-polls-icon">📭</div>
            <h3>暂无可用投票</h3>
            <p>当前没有正在进行的投票，请稍后再查看</p>
        </div>
    {% endif %}
</div>

<style>
    @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');
    
    :root {
        --primary: #5B8FF9;
        --primary-dark: #3A72E0;
        --secondary: #6DD3CE;
        --text-dark: #2C3E50;
        --text-medium: #57687A;
        --text-light: #95A5A6;
        --bg-light: #F5F7FA;
        --bg-white: #FFFFFF;
        --border-radius: 16px;
        --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
        --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
        --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
        --transition: all 0.3s ease;
    }
    
    body {
        font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        background-color: var(--bg-light);
        color: var(--text-dark);
        line-height: 1.6;
        margin: 0;
        padding: 20px;
    }
    
    .poll-list-container {
        max-width: 800px;
        margin: 40px auto;
        padding: 30px;
        background: var(--bg-white);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-lg);
    }
    
    .poll-header {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .poll-list-title {
        color: var(--text-dark);
        font-size: 28px;
        font-weight: 700;
        margin-bottom: 8px;
        position: relative;
        display: inline-block;
    }
    
    .poll-list-title:after {
        content: "";
        position: absolute;
        bottom: -10px;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: linear-gradient(90deg, var(--primary), var(--secondary));
        border-radius: 3px;
    }
    
    .poll-subtitle {
        color: var(--text-light);
        font-size: 15px;
        margin-top: 15px;
    }
    
    .poll-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .poll-item {
        margin-bottom: 15px;
        transition: var(--transition);
    }
    
    .poll-link {
        display: flex;
        align-items: center;
        padding: 18px 20px;
        background: var(--bg-white);
        border-radius: 12px;
        text-decoration: none;
        color: var(--text-medium);
        transition: var(--transition);
        border: 1px solid rgba(0,0,0,0.05);
    }
    
    .poll-link:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
        border-color: rgba(91, 143, 249, 0.2);
        color: var(--primary-dark);
    }
    
    .poll-icon {
        font-size: 24px;
        margin-right: 20px;
        color: var(--primary);
        flex-shrink: 0;
    }
    
    .poll-content {
        flex-grow: 1;
    }
    
    .poll-question {
        font-size: 18px;
        font-weight: 500;
        margin: 0 0 5px 0;
        color: var(--text-dark);
    }
    
    .poll-meta {
        font-size: 14px;
        color: var(--text-light);
    }
    
    .poll-arrow {
        font-size: 24px;
        color: var(--text-light);
        margin-left: 10px;
        transition: var(--transition);
    }
    
    .poll-link:hover .poll-arrow {
        color: var(--primary);
        transform: translateX(5px);
    }
    
    .no-polls {
        text-align: center;
        padding: 40px 20px;
    }
    
    .no-polls-icon {
        font-size: 50px;
        margin-bottom: 20px;
        opacity: 0.7;
    }
    
    .no-polls h3 {
        font-size: 20px;
        color: var(--text-dark);
        margin-bottom: 10px;
    }
    
    .no-polls p {
        color: var(--text-light);
        font-size: 15px;
        margin: 0;
    }
    /* 后台管理按钮样式 */
.admin-access-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(91, 143, 249, 0.1);
    color: var(--primary);
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(91, 143, 249, 0.3);
}

.admin-access-btn:hover {
    background: rgba(91, 143, 249, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(91, 143, 249, 0.2);
}

.admin-access-btn svg {
    flex-shrink: 0;
}

/* 调整容器定位 */
.poll-list-container {
    position: relative;
    padding-top: 20px; /* 为按钮留出空间 */
}
</style>